home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 13
/
AMIGAplus Sonderheft 13 (1998)(ICP)(DE)[!].iso
/
rexx
/
polar_to_rect.scrx
< prev
next >
Wrap
Text File
|
1994-11-16
|
683b
|
38 lines
/* SciCalc Scientific Calculator
by Brian Savage
Arexx script to convert polar coordinates to
cartesian coordinates.
This script requires RexxMathLib.library
*/
if ~show("l", "rexxmathlib.library") then
if ~addlib("rexxmathlib.library", 0, -30,0) then
do
address command
say "Can't find RexxMathLib"
end
options results
getreg 1 /* theta (radians) -> from register #1 */
parse var result theta
getval /* r -> displayed value */
parse var result r
putval r*cos(theta) /* x -> displayed value */
putreg 1 r*sin(theta) /* y -> returned in register 1 */